To date, switches, which are communication devices for relaying frames, have been used in frame communication networks such as Ethernet (registered trademark). A switch employs a media access control (MAC) learning function in order to perform frame transfer.
That is, when a frame is received, a switch that employs a MAC learning function stores a correspondence relationship between a port at which the frame is received and the MAC address of a terminal that is the transmission source of the frame, in a table called a MAC learning table. When receiving a frame destined for a MAC address stored in the MAC learning table from another port, the switch transfers the received frame from a port that has been learned in the MAC learning table.
In recent years, there has been proposed a learning scheme in which the MAC addresses of terminals are learned for each group called a virtual local area network (VLAN) where terminals connected via a port to a switch are virtually combined into a group. In this learning scheme, a switch holds, in a MAC learning table, a correspondence relationship among a port, a MAC address, and an identifier (referred to as a VLAN ID) of a VLAN to which a terminal having the MAC address belongs. The switch further holds, in the MAC learning table, the number of learned correspondence relationships and a maximum number of learned correspondence relationships in association with the VLAN ID. Upon receipt of a frame, the switch compares the number of learned correspondence relationships with the maximum number of learned correspondence relationships, both of which are associated with a VLAN ID contained in the frame, and does not learn the source MAC address of the frame if the number of learned correspondence relationships has reached the maximum number of learned correspondence relationships. Thus, the fairness among VLANs in the number of MAC addresses learned in the MAC learning table is maintained.
A related technique is disclosed in, for example, Japanese Laid-open Patent Publication No. 2004-194145.
In the above-described related-art technique, however, consideration has not been given to achieving efficient address learning in accordance with priorities while securing a minimum number of learned correspondence relationships for each group.
That is, in the related-art technique, even when a frame is received from a VLAN, the source MAC address of the frame is not learned if the number of learned correspondence relationships in the MAC learning table has reached the maximum number of learned correspondence relationships associated with the VLAN ID. For this reason, in the related-art technique, if the total of the numbers of learned correspondence relationships associated with VLAN IDs of VLANs having relatively high priorities and the VLAN IDs of VLANs having relatively low priorities has reached the total of maximum numbers of learned correspondence relationships. As a result, with the related-art technique, there is a possibility that a frame from a VLAN having a relatively high priority may be discarded or flooded.